module.exports = `
  enum ProgressState {
    start
    done
    check
    redo
  }

  type Progress {
    id: ID!
    type: String
    name: String
    subTaskCount: Int
    isPublished: Int
    finishAt: String
    costSeconds: Int
    correctCount: Int
    rating: Int
    likeCount: Int
    state: ProgressState
    stateName:String
    expireAt: String
    isExpired: Boolean
    createdAt: String
    updatedAt: String
    user: User
    member: Member
    task: Task
    creator: User
    document: Document
    answers: [Answer]
    unreadCount: Int
    liked: Boolean
    teacherCheckedStatus: String
    exerciseStatus: String
    submissionId: Int
    assignmentId: Int
    classId: Int
  }

  type PageModalProgress implements Page {
    totalCount: Int
    hasMore: Boolean
    totalPages: Int
    pageIndex: Int
    pageSize: Int
    rows: [Progress]
  }

  extend type Query {
    # 通过ID获取进度记录
    progress(id: ID!): Progress

    # 列出学生的进度列表
    userProgresses(pageIndex: Int = 0, pageSize: Int = 20): PageModalProgress

    # 获取我的未处理任务数
    progressGetMyUnreadCount: Int!
  }

  extend type Mutation {
    # 客户端利用分享链接中的documentId，通过文档(题目)创建作业(任务)进度
    # 指定groupId或取token的userId，避免重复创建作业
    createDocumentProgress(documentId: ID!, groupId: ID, distributeAt: String): Progress
    # 通过作业(任务) ID 创建进度记录
    createProgress(taskId: ID!): Progress
    # 重置progress及相关task,document的未读计数
    readProgress(progressId: ID!): Progress

    # 通过作业(任务) ID 创建进度记录
    createProgressByAgid(agid: String!): Progress
  }

`
